<template>
  <div class="about">
    <h1>This is an about page</h1>
    <ul v-for="item in list" :key="item.id" @click="handleClick(item)">
      <img :src="item.img" alt="" />
      {{
        item.title
      }}
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    }
  },
  async created() {
    const data = await this.$http.get('http://localhost:9999/cartList')
    console.log('res:', data)
    this.list = data
  },
  methods: {
    handleClick(item) {
      this.$router.push(`/detail/${item.id}`)
    },
  },
}
</script>
